<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
							 手机号：<input type="text" name="mobile"/>
							</li>

							<li>
								账单类型 ：
								<select name="billType" th:with="type=${@dict.getType('bill_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
<li>
								交易类型 ：
								<select name="transType" th:with="type=${@dict.getType('trans_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							
							<li>
								 转账积分类型：
								 <select name="coinType" th:with="type=${@dict.getType('score_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>

							<li>
								收支方向：
								<select name="direction" th:with="type=${@dict.getType('direction')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>

						

							<li>
								交易状态：
								<select name="status" th:with="type=${@dict.getType('trans_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>


							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manager:transactionFlow:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="manager:transactionFlow:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manager:transactionFlow:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manager:transactionFlow:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('manager:transactionFlow:edit')}]];
        var removeFlag = [[${@permission.hasPermi('manager:transactionFlow:remove')}]];
        var prefix = ctx + "manager/transactionFlow";
        var scoreType = [[${@dict.getType('score_type')}]];
        var billType = [[${@dict.getType('bill_type')}]];
        var transType = [[${@dict.getType('trans_type')}]];
        var coinType = [[${@dict.getType('coin_type')}]];
        var direction = [[${@dict.getType('direction')}]];
        var transStatus = [[${@dict.getType('trans_status')}]];
        
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "交易流水",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '主键',
					visible: false
				},
				{
					field : 'mobile', 
					title : '手机号',
					sortable: true
				},
				{
					field : 'billType', 
					title : '账单类型 ',
					sortable: true,formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(billType, value);
		            }}, 
	            {
					field : 'transType', 
					title : '交易类型',
					sortable: true,formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(transType, value);
		            }},
				{
					field : 'amount', 
					title : '交易金额',
					sortable: true,formatter: function(value, row, index) {
		            	return (parseFloat(value)/100000000.0).toFixed(8);
		            }
				},
				{
					field : 'coinType', 
					title : '交易积分类型',
					sortable: true,formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(coinType, value);
		            }}, 
				{
					field : 'direction', 
					title : '收支方向',
					sortable: true,formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(direction, value);
		            }},
		            {
						field : 'transHash', 
						title : '交易HASH',
						sortable: true
					},
		            {
						field : 'turnOutWallet', 
						title : '转出地址',
						sortable: true
					},
					{
						field : 'turnInWallet', 
						title : '接收地址',
						sortable: true
					},
					{
						field : 'transFee', 
						title : '交易手续费',
						sortable: true
					},
				{
					field : 'transTime', 
					title : '交易发生时间',
					sortable: true
				},
				{
					field : 'status', 
					title : '交易状态',
					sortable: true,formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(transStatus, value);
		            }}, 
				
				
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>